send API requests in Python